package com.prd.controller;

import com.prd.model.EntNarrationSummary;
import com.prd.service.EntNarrationSummaryService;
import com.prd.util.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"述职面谈纪要"})
@RestController
@RequestMapping("/api/entNarrationSummary")
public class EntNarrationSummaryController extends BaseController {

    @Autowired
    private EntNarrationSummaryService entNarrationSummaryService;

    @ApiOperation("添加信息")
    @PostMapping("add")
    public AjaxResult add(@RequestBody EntNarrationSummary entNarrationSummary) {
        return toAjax(entNarrationSummaryService.insertInfo(entNarrationSummary));
    }

    @ApiOperation("修改信息")
    @PostMapping("update")
    public AjaxResult update(@RequestBody EntNarrationSummary entNarrationSummary) {
        return toAjax(entNarrationSummaryService.updateInfo(entNarrationSummary));
    }

    @ApiOperation("删除信息")
    @PostMapping("remove/{id}")
    public AjaxResult remove(@PathVariable("id") Long id) {
        return toAjax(entNarrationSummaryService.removeById(id));
    }

    @ApiOperation("审核确认")
    @PostMapping("checkRecord/{summaryId}")
    public AjaxResult checkRecord(@PathVariable("summaryId") Long summaryId) {
        return toAjax(entNarrationSummaryService.checkRecord(summaryId));
    }
}
